<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app">
      <input type="text" @keyup="onKeyUp" v-model="value" name="" id="" />
    </div>
    <script src="./node_modules/axios/dist/axios.js"></script>
    <script src="./node_modules/vue/dist/vue.js"></script>
    <script>
      new Vue({
        el: '#app',
        data: {
          value: '',
        },
        methods: {
          onKeyUp(e) {
            console.log(e)
          },
        },
      })

      // axios.get('./data.json').then((res) => {
      //   console.log('res:', res)
      // })
      // 模拟一个异步数据接口？
      // 异步现象哪些？定时器 ajax
      // function axios() {
      //   return new Promise((resolve, reject) => {
      //     setTimeout(() => {
      //       resolve({ code: 0, msg: 'success', data: ['1', '2'] })
      //     }, 1000)
      //   })
      // }

      // axios().then((res) => {
      //   console.log('res:', res)
      // })
    </script>
  </body>
</html>
